package com.chenjun.core.vo.sys;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.BeanUtils;

import com.chenjun.core.dao.generator.entity.SysDictionary;

/**
 * 
 * @ClassName: SysDictionaryService 
 * @author Sean Cui
 * @date 2016-06-14 下午17:50:00 
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @version V1.0.0.0
 * @comment 该文件通过代码生成器生成，如果修改次文件后，重新生成时将覆盖修改内容，请修改生成模板或做好备份
 */

@SuppressWarnings("serial")
public class SysDictionaryDto implements Serializable{
	
    /**
     * 系统字典表  
     * db_column: id 
     */	
	private String id;
    /**
     * 参数类型  
     * db_column: type 
     */	
	@NotEmpty(message="类型不能为空")
	private String type;
    /**
     * 参数代码  
     * db_column: code 
     */	
	private String code;
    /**
     * 参数值  
     * db_column: name 
     */	
	@NotEmpty(message="名称不能为空")
	private String name;
    /**
     * 描述说明  
     * db_column: description 
     */	
	private String description;
    /**
     * 创建时间  
     * db_column: created_time 
     */	
	private Date createdTime;
	
	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}
	
	public String getId() {
		return this.id;
	}
	public void setType(String type) {
		this.type = type == null ? null : type.trim();
	}
	
	public String getType() {
		return this.type;
	}
	public void setCode(String code) {
		this.code = code == null ? null : code.trim();
	}
	
	public String getCode() {
		return this.code;
	}
	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}
	
	public String getName() {
		return this.name;
	}
	public void setDescription(String description) {
		this.description = description == null ? null : description.trim();
	}
	
	public String getDescription() {
		return this.description;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	
	public Date getCreatedTime() {
		return this.createdTime;
	}
	
	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysDictionaryDto getDtoByModel(SysDictionary source) throws IllegalAccessException, InvocationTargetException{
		SysDictionaryDto target = new SysDictionaryDto();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysDictionary getModelByDto(SysDictionaryDto source) throws IllegalAccessException, InvocationTargetException{
		SysDictionary target = new SysDictionary();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
